
#include <stdio.h>
#include "STL_Async.h"
#include <unistd.h>
#include <chrono> //计时器

using namespace STL;

void test(int count)
{
    int index;
    while (1)
    {
        printf("th[%d/%d]\n", index, count);
        if (index++ >= count)
            break;
        std::this_thread::sleep_for(std::chrono::seconds(1));
    }
}

int main(int argc, char *argv[])
{
    for (int i; i < 100; i++)
    {
        STL_ASYNC(test, i);
    }

    int i = 0;
    while (1)
    {
        printf("[%d]main\n", i++);
        sleep(1);
    }
    return 0;
}
